#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@class FWListView;
@class FWApplication;
@class FWPreferences;
@class LITableView;


@protocol FWListViewDelegate <NSObject>

- (CGFloat)tableView:(LITableView *)tableView heightForItem:(NSObject*)item application:(FWApplication*)application preferences:(FWPreferences*)prefs;
- (void)tableView:(LITableView*)tableView setDetailsUsingView:(FWListView*)view forItem:(NSObject*)item application:(FWApplication*)app preferences:(FWPreferences*)prefs;
- (UIView*)tableView:(LITableView*)tableView previewWithFrame:(CGRect)rect atIndex:(NSInteger)index forItems:(NSArray*)list application:(FWApplication*)app preferences:(FWPreferences*)prefs;
- (NSString*)tableView:(LITableView*)tableView detailForHeaderInSection:(NSInteger)section application:(FWApplication*)app preferences:(FWPreferences*)prefs;

- (FWListView*)application:(FWApplication*)app cellViewForTableView:(LITableView*)tableView preferences:(FWPreferences*)prefs;
- (NSArray*)application:(FWApplication*)application fetchNewDataForPrefs:(FWPreferences*)prefs;
- (BOOL)application:(FWApplication*)application shouldUpdateForDate:(NSDate*)date;


@optional

- (void)application:(FWApplication*)app repeatingEventWithPluginPrefs:(FWPreferences*)prefs;

- (NSInteger)tableView:(LITableView*)tableView totalNumberOfItems:(FWApplication*)application preferences:(FWPreferences*)prefs;

// Statusbar support
- (BOOL)application:(FWApplication*)app isStatusbarRequiredForPrefs:(FWPreferences*)prefs;
- (NSArray*)application:(FWApplication*)app statusbarItemsForPrefs:(FWPreferences*)prefs;
- (NSString*)application:(FWApplication*)app statusbarCaptionForPrefs:(FWPreferences*)prefs;
- (NSString*)application:(FWApplication*)app statusbarBadgeForPrefs:(FWPreferences*)prefs;
- (NSString*)application:(FWApplication*)app statusbarCaptionIconForPrefs:(FWPreferences*)prefs;
- (NSInteger)application:(FWApplication*)app statusbarIndentForPrefs:(FWPreferences*)prefs;
- (BOOL)application:(FWApplication*)app shouldRebuildStatusbar:(NSArray*)items prefs:(FWPreferences*)prefs;
- (BOOL)application:(FWApplication*)app configureStatusbarItems:(NSArray*)items prefs:(FWPreferences*)prefs;

// Toolbar support
- (NSArray*)application:(FWApplication*)app toolbarItemsForPrefs:(FWPreferences*)prefs;
- (BOOL)application:(FWApplication*)app configureToolbarItems:(NSArray*)items prefs:(FWPreferences*)prefs;

// System status bar support
- (NSString*)libstatusbarIconName;
- (BOOL)showLibstatusbarIconForItems:(NSArray*)items preferences:(FWPreferences*)prefs;

@end


@interface FWBarButtonItem : UIBarButtonItem
{
    UITableView* tableView;
}

@property (nonatomic, assign) UITableView* tableView;


@end